% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/table_order_variables.R
\name{table_order_variables}
\alias{table_order_variables}
\title{Get order of variable names to sort by, as seen in EJScreen Community Report}
\usage{
table_order_variables(
  varnames,
  s1 = "ejscreensort",
  s2 = "sortvarlistEJSCREENREPORT",
  s3 = "sort_within_varlistEJSCREENREPORT"
)
}
\arguments{
\item{varnames}{vector of indicator variables names from blockgroupstats, bgej, etc.,
such as "pm", "pctlowinc", "pctile.EJ.DISPARITY.traffic.score.eo" etc.
and others as found in names_all_r, or specific subsets of those like
in c(names_d, names_d_subgroups, names_e) and
c(names_ej_pctile, names_ej_state_pctile, names_ej_supp_pctile, names_ej_supp_state_pctile)}

\item{s1}{name of column in map_headernames to get sort info from}

\item{s2}{optional like s1 but secondary to s1}

\item{s3}{optional tertiary}
}
\value{
vector as from order(), to be used in sorting a data.frame for example
}
\description{
Get order of variable names to sort by, as seen in EJScreen Community Report
}
\examples{
  cbind(table_order_variables(c(names_d, names_d_subgroups, names_e)))
  
  out <- testoutput_ejamit_10pts_1miles
  vars <- out$formatted[ , 'indicator']
  vars <- fixcolnames(vars, 'long', 'r')
  out$formatted[table_order_variables(vars), ]
  

}
